
function CreateNPC( x, y, sprtable )
	
	local ent = Entity:New();
	
	for k, v in pairs( sprtable ) do
		
		ent:AddSprite( v );
		
	end
	
	ent:SetPos( x, y );
	ent:SetCurrentSprite( 0 );
	
	ent:GiveNPCLogic();
	
	return ent;
	
end

function CreateNPCFromData( name, x, y )
	
	local data = GetNPCData( name );
	
	local ent = CreateNPC( x, y, data.Sprites );
	
	if( data.ShadowInfo ) then
		ent:AddShadow( data.ShadowInfo.xmul, data.ShadowInfo.ymul, data.ShadowInfo.xoffset, data.ShadowInfo.yoffset );
	end
	
	if( data.CollisionBox ) then
		ent:AddCollisionBox( 0, data.CollisionBox.x, data.CollisionBox.y, true );
	end
	
	if( data.Scale ) then
		ent:Scale( data.Scale.x, data.Scale.y );
	end
	
	return ent;
	
end

function SetBattleDrawFunc( f )

	BattleDrawFunc = f;

end

--Use this instead of Engine.StartBattle
function StartBattle( ply, en, think, endfunc )
	
	SetBattleDrawFunc( nil );
	Engine.StartBattle( ply, en, think, endfunc );
	
end